import axios from 'axios'
import {baseURL} from '../configFile'

const axiosReq = axios.create({
    baseURL
})

//删除轮播图
export const deleteSlidePicture = (slidePictureID: number) => {
    return axiosReq.post('/deleteSlidePicture', { slidePictureID } )
}

//新增轮播图
export const addSlidesPicture = (file: File, pictureDescription: string) => {
    const formData = new FormData();
    formData.append('file', file);
    formData.append('pictureDescription', pictureDescription)
    return axiosReq.post('/addSlidesPicture', formData);
}

//请求轮播图
export const slideReq = () => {
    return axiosReq.get('/queryslidepicture')
}

//请求平台概况
export const platformOverviewReq = () => {
    return axiosReq.get('/queryPlatformOverview')
}
//修改平台概况
export const modifyPlatformOverviewReq = (content: string) => {
    return axiosReq.post('/modifyPlatformOverview', { 'Article': content })
}
